import React, { Component } from 'react'
import { Button, Text, View ,StyleSheet} from 'react-native'

export default class UserShow extends Component {
    _del=uid=>{
        this.props.onDeleteUser(uid)
    }
    _update=uid=>{
       this.props.onSelectCurrent(uid) 
    }
    render() {
        return (
            <View style={styles.user}>
                <Text style={styles.userTxt}>{this.props.user.uname}</Text>
                <Text style={styles.userTxt}>{this.props.user.address}</Text>
                <Button onPress={()=>this._del(this.props.user.id)} title="删除"/>
                <Button onPress={()=>this._update(this.props.user.id)} title="更新"/>
            </View>
        )
    }
}
const styles = StyleSheet.create({
   user:{flexDirection:'row',justifyContent:'space-between'}, 
   userTxt:{fontSize:36}
})


